<!DOCTYPE html>
<html lang="en">

<head>
    <title>赛事竞猜</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <script src="../../js/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" href="../../css/public.css">
    <style>
        .register_bg {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            background: url('../images/reg/bg.png') center no-repeat;
            background-size: 100%;
            z-index: 1;
        }

        .home_zhangdui_nav {
            overflow: hidden;
            background: #021349 url('../../images/reg/back.png') 10px center no-repeat;
            background-size: .7rem;
        }

        .list{
            margin-top: 60px;
        }
        .list img{
            width: 45%;
            margin: 0 2.2%;
            margin-bottom: 10px;
            background: url(../../images/home/bg-competition.png) center no-repeat;
            background-size: 100%;
        }
        .list a{
            position: relative;
        }
        .qgc{
            display: block;
            position: absolute;
            height: 30px;
            width: 90%;
            top: -26px;
            text-align: center;
            background: url(../../images/home/iamge_intersperse.png) center no-repeat;
            background-size: 100%;
            line-height: 30px;
            color: #FFFFFF;
            left: 4%;
        }
    </style>
</head>

<body>

    <div class="register_bg">
        <div class="home_zhangdui_nav">
            <span class="goBack"></span>
            
        </div>

        <div class="list">
            <!-- <a >
                <img src="../../images/home/image_Competition_qgc.png" alt="">
                <div class="qgc">QGC联赛</div>
            </a> -->
            <!-- <a>
                <img src="../../images/home/image_Competition_tga.png" alt="">
                <div class="qgc">TGA联赛</div>
            </a>
            <a >
                <img src="../../images/home/image_Competition_kpl.png" alt="">
                <div class="qgc">KPL联赛</div>
            </a>
            <a >
                <img src="../../images/home/image_Competition_ciity.png" alt="">
                <div class="qgc">王者城市联赛</div>
            </a> -->
            <!-- <a >
                <img src="../../images/home/image_Competition_ciity.png" alt="">
                <div class="qgc">企业赞助赛</div>
            </a> -->
        </div>
    </div>
    <script src="../../js/public.js"></script>
    <script>
        $(function () {
            let path = window.location.href
            let gameId = path.split('?')[1].split('=')[1]
 
            
            $.post(raceList,{gameId},res=>{
    
                let obj=res.obj;
                if(obj[0].fdGameName!=''){
                   let span=`<span >${obj[0].fdGameName}</span>`;
                    $('.home_zhangdui_nav').append(span)

                obj.forEach((item,index) => {
                    if(item.fdGameId==gameId){
                    let gameBg=item.fdRacePic
                     $('.list a').eq(index).find('div').text(item.fdName)
                        let fdId=item.fdId,
                            a;
                        
                             a=`<a >
                <img src="../../images/home/image_Competition_qgc.png" alt="">
                <div class="qgc">${item.fdName}</div>
            </a>`
                        $('.list').append(a)
                        $('.list a').eq(index).find('img').click(function(){
                            window.location.href=`./jcRoom.html?fdid=${fdId}`
                        })
                        }
                } )
                }
                else{
                     a=`<a >
                <img src="../../images/home/image_Competition_qgc.png" alt="">
                <div class="qgc">暂无数据</div>
            </a>`
                        $('.list').append(a)
                
                }

            })
        })
    </script>
</body>

</html>